package com.situ.mall.base.util;

import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;

/**
 * ClassName: Md5Util
 * Package: com.situ.mall.util
 * Description:
 *
 * @Author Darling_达
 * @Create 2023-03-17 15:12
 * @Version 1.0
 */
public class Md5Util {


    public static String md5(String str) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(str.getBytes(StandardCharsets.UTF_8));
            return new BigInteger(1, md.digest()).toString(16);
        } catch (Exception e) {
            System.out.println("======");
        }
        return null;
    }

}
